Skip to content

feat: support access key signing via root_account#93

Open
gakonst wants to merge 2 commits intomainfrom
access-key-signing
Open

feat: support access key signing via root_account#93
gakonst wants to merge 2 commits intomainfrom
access-key-signing

Conversation

@gakonst
Copy link
Contributor

@gakonst gakonst commented Mar 21, 2026

Wire root_account into _build_tempo_transfer so that smart wallet access keys can sign transactions on behalf of the wallet.

Changes

src/mpp/methods/tempo/client.py:

  • Use root_account address for get_tx_params (nonce comes from the wallet, not the access key)
  • Use root_account for estimate_gas (same reason)
  • Use pytempo.sign_tx_access_key() when root_account is set — builds a Keychain V2 signature (0x04 || root_addr || inner_sig) and sets sender_address to the wallet
  • Set credential source to the root_account address

tests/test_tempo.py: 3 new tests covering access key signing, access key + fee payer, and the existing no-root-account path.

Why

root_account was declared on TempoMethod but never used. This meant passkey-based Tempo wallets (which use access keys with spending limits) could not use pympp — the transaction would be signed by the access key directly, which has no on-chain balance.

Testing

  • All 394 existing tests pass (+ 3 new)
  • End-to-end tested against modal.mpp.tempo.xyz: sandbox create → exec → terminate all succeed with access key + fee payer
method = tempo(
    account=TempoAccount.from_env(),        # access key
    root_account="0x975937...",              # smart wallet address
    intents={"charge": ChargeIntent()},
)
async with Client(methods=[method]) as client:
    r = await client.post("https://modal.mpp.tempo.xyz/sandbox/create", json={...})
    # 200 OK ✓

gakonst and others added 2 commits March 21, 2026 13:27
Wire root_account into _build_tempo_transfer so that smart wallet
access keys can sign transactions on behalf of the wallet:

- Use root_account address for get_tx_params (nonce) and estimate_gas
- Use pytempo.sign_tx_access_key() when root_account is set, which
  builds a Keychain V2 signature (0x04 || root_addr || inner_sig)
- Set credential source to root_account address (the wallet)

This enables passkey-based Tempo wallets with access keys to use
pympp. Previously root_account was declared but unused.

Works with fee payer (0x78 envelope) — tested end-to-end against
modal.mpp.tempo.xyz.

Amp-Thread-ID: https://ampcode.com/threads/T-019d0db3-f0b0-73aa-9403-704f79d8d9f1
Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant